#include "nano_package.h"
#include <godot_cpp/core/class_db.hpp>
using namespace godot;


void NanoPackage::_bind_methods() {
	// Add method bindings here.
	BIND_ENUM_CONSTANT(TYPE_HANDSHAKE);
	BIND_ENUM_CONSTANT(TYPE_HANDSHAKE_ACK);
	BIND_ENUM_CONSTANT(TYPE_HEARTBEAT);
	BIND_ENUM_CONSTANT(TYPE_DATA);
	BIND_ENUM_CONSTANT(TYPE_KICK);

	ClassDB::bind_method(D_METHOD("set_type", "type"), &NanoPackage::set_type);
	ClassDB::bind_method(D_METHOD("get_type"), &NanoPackage::get_type);
	ClassDB::bind_method(D_METHOD("set_body", "body"), &NanoPackage::set_body);
	ClassDB::bind_method(D_METHOD("get_body"), &NanoPackage::get_body);
	ClassDB::bind_method(D_METHOD("is_valid"), &NanoPackage::is_valid);

	ADD_PROPERTY(PropertyInfo(Variant::INT, "type",PROPERTY_HINT_ENUM,"TYPE_HANDSHAKE,TYPE_HANDSHAKE_ACK,TYPE_HEARTBEAT,TYPE_DATA,TYPE_KICK"), "set_type", "get_type");
	ADD_PROPERTY(PropertyInfo(Variant::PACKED_BYTE_ARRAY, "body"), "set_body", "get_body");

	

}
